﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using BLL;
using DAL;
using Models;
using System.Data;
using System.Text;
using System.Xml;
using Gift.WebApp;
public partial class backstage_applyingfora_job : System.Web.UI.Page
{
    // Fields
    protected string account = "";
    protected string age = "";
    protected ApplyingforaJobManager ajm = new ApplyingforaJobManager();
    protected string createTime = "";
    protected string degree = "";
    protected string email = "";
    protected string jobTitle = "";
    protected string name = "";
    protected string professiona = "";
    protected string remark = "";
    protected string sex = "";
    protected string telphone = "";
    protected string workExperience = "";

    // Methods
    private void ApplyingforaJobBind()
    {
        try
        {
            DataTable applyingforaJobById = this.ajm.GetApplyingforaJobById(Convert.ToInt32(base.Request.QueryString["id"]));
            if (applyingforaJobById.Rows.Count > 0)
            {
                this.jobTitle = applyingforaJobById.Rows[0]["jobTitle"].ToString();
                this.name = applyingforaJobById.Rows[0]["name"].ToString();
                this.age = applyingforaJobById.Rows[0]["age"].ToString();
                if (Convert.ToInt32(applyingforaJobById.Rows[0]["sex"]) == 1)
                {
                    this.sex = "男";
                }
                else
                {
                    this.sex = "女";
                }
                this.account = applyingforaJobById.Rows[0]["account"].ToString();
                this.degree = applyingforaJobById.Rows[0]["degree"].ToString();
                this.professiona = applyingforaJobById.Rows[0]["professiona"].ToString();
                this.telphone = applyingforaJobById.Rows[0]["telphone"].ToString();
                this.email = applyingforaJobById.Rows[0]["email"].ToString();
                this.workExperience = applyingforaJobById.Rows[0]["workExperience"].ToString();
                this.remark = applyingforaJobById.Rows[0]["remark"].ToString();
                this.createTime = applyingforaJobById.Rows[0]["createTime"].ToString();
            }
        }
        catch
        {
        }
    }

    public StringBuilder GetBcakLocation()
    {
        StringBuilder builder = new StringBuilder();
        try
        {
            if (base.Request.QueryString["rid"] != null)
            {
                builder.Append("location.href='applyingfora_job_list.aspx?rid=" + base.Request.QueryString["rid"] + "';");
            }
        }
        catch
        {
        }
        return builder;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if ((HttpContext.Current.Session["admin_user"] == null) && (HttpContext.Current.Session["language_version"] == null))
        {
            base.ClientScript.RegisterStartupScript(base.GetType(), "sJs", "top.location=\"login.html\";", true);
        }
        if (!base.IsPostBack && (base.Request.QueryString["id"] != null))
        {
            this.ApplyingforaJobBind();
        }
    }

}